<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>FileAlterationObserver (Apache Commons IO 2.5 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="FileAlterationObserver (Apache Commons IO 2.5 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FileAlterationObserver.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/io/monitor/FileAlterationObserver.html" target="_top">Frames</a></li>
<li><a href="FileAlterationObserver.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.io.monitor</div>
<h2 title="Class FileAlterationObserver" class="title">Class FileAlterationObserver</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.io.monitor.FileAlterationObserver</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">FileAlterationObserver</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">FileAlterationObserver represents the state of files below a root directory,
 checking the filesystem and notifying listeners of create, change or
 delete events.
 <p>
 To use this implementation:
 <ul>
   <li>Create <a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor"><code>FileAlterationListener</code></a> implementation(s) that process
      the file/directory create, change and delete events</li>
   <li>Register the listener(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> for
       the appropriate directory.</li>
   <li>Either register the observer(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a> or
       run manually.</li>
 </ul>

 <h2>Basic Usage</h2>
 Create a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> for the directory and register the listeners:
 <pre>
      File directory = new File(new File("."), "src");
      FileAlterationObserver observer = new FileAlterationObserver(directory);
      observer.addListener(...);
      observer.addListener(...);
 </pre>
 To manually observe a directory, initialize the observer and invoked the
 <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#checkAndNotify()"><code>checkAndNotify()</code></a> method as required:
 <pre>
      // intialize
      observer.init();
      ...
      // invoke as required
      observer.checkAndNotify();
      ...
      observer.checkAndNotify();
      ...
      // finished
      observer.finish();
 </pre>
 Alternatively, register the oberver(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a>,
 which creates a new thread, invoking the observer at the specified interval:
 <pre>
      long interval = ...
      FileAlterationMonitor monitor = new FileAlterationMonitor(interval);
      monitor.addObserver(observer);
      monitor.start();
      ...
      monitor.stop();
 </pre>

 <h2>File Filters</h2>
 This implementation can monitor portions of the file system
 by using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>s to observe only the files and/or directories
 that are of interest. This makes it more efficient and reduces the
 noise from <i>unwanted</i> file system events.
 <p>
 <a href="http://commons.apache.org/io/">Commons IO</a> has a good range of
 useful, ready made 
 <a href="../filefilter/package-summary.html">File Filter</a>
 implementations for this purpose.
 <p>
 For example, to only observe 1) visible directories and 2) files with a ".java" suffix
 in a root directory called "src" you could set up a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> in the following
 way:
 <pre>
      // Create a FileFilter
      IOFileFilter directories = FileFilterUtils.and(
                                      FileFilterUtils.directoryFileFilter(),
                                      HiddenFileFilter.VISIBLE);
      IOFileFilter files       = FileFilterUtils.and(
                                      FileFilterUtils.fileFileFilter(),
                                      FileFilterUtils.suffixFileFilter(".java"));
      IOFileFilter filter = FileFilterUtils.or(directories, files);

      // Create the File system observer and register File Listeners
      FileAlterationObserver observer = new FileAlterationObserver(new File("src"), filter);
      observer.addListener(...);
      observer.addListener(...);
 </pre>

 <h2>FileEntry</h2>
 <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><code>FileEntry</code></a> represents the state of a file or directory, capturing
 <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> attributes at a point in time. Custom implementations of
 <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><code>FileEntry</code></a> can be used to capture additional properties that the
 basic implementation does not support. The <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html#refresh(java.io.File)"><code>FileEntry.refresh(File)</code></a>
 method is used to determine if a file or directory has changed since the last
 check and stores the current state of the <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a>'s properties.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: FileAlterationObserver.java 1686747 2015-06-21 18:44:49Z krosenvold $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor"><code>FileAlterationListener</code></a>, 
<a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a>, 
<a href="../../../../../serialized-form.html#org.apache.commons.io.monitor.FileAlterationObserver">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.io.File)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory)</code>
<div class="block">Construct an observer for the specified directory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(org.apache.commons.io.monitor.FileEntry,%20java.io.FileFilter,%20org.apache.commons.io.IOCase)">FileAlterationObserver</a></strong>(<a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor">FileEntry</a>&nbsp;rootEntry,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.io.File,%20java.io.FileFilter)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</code>
<div class="block">Construct an observer for the specified directory and file filter.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.io.File,%20java.io.FileFilter,%20org.apache.commons.io.IOCase)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.lang.String)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName)</code>
<div class="block">Construct an observer for the specified directory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.lang.String,%20java.io.FileFilter)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</code>
<div class="block">Construct an observer for the specified directory and file filter.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver(java.lang.String,%20java.io.FileFilter,%20org.apache.commons.io.IOCase)">FileAlterationObserver</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#addListener(org.apache.commons.io.monitor.FileAlterationListener)">addListener</a></strong>(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</code>
<div class="block">Add a file system listener.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#checkAndNotify()">checkAndNotify</a></strong>()</code>
<div class="block">Check whether the file and its chlidren have been created, modified or deleted.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#destroy()">destroy</a></strong>()</code>
<div class="block">Final processing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getDirectory()">getDirectory</a></strong>()</code>
<div class="block">Return the directory being observed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getFileFilter()">getFileFilter</a></strong>()</code>
<div class="block">Return the fileFilter.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getListeners()">getListeners</a></strong>()</code>
<div class="block">Returns the set of registered file system listeners.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#initialize()">initialize</a></strong>()</code>
<div class="block">Initialize the observer.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#removeListener(org.apache.commons.io.monitor.FileAlterationListener)">removeListener</a></strong>(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</code>
<div class="block">Remove a file system listener.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#toString()">toString</a></strong>()</code>
<div class="block">Provide a String representation of this observer.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="FileAlterationObserver(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName)</pre>
<div class="block">Construct an observer for the specified directory.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - the name of the directory to observe</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(java.lang.String, java.io.FileFilter)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</pre>
<div class="block">Construct an observer for the specified directory and file filter.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - the name of the directory to observe</dd><dd><code>fileFilter</code> - The file filter or null if none</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(java.lang.String, java.io.FileFilter, org.apache.commons.io.IOCase)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - the name of the directory to observe</dd><dd><code>fileFilter</code> - The file filter or null if none</dd><dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(java.io.File)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory)</pre>
<div class="block">Construct an observer for the specified directory.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory to observe</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(java.io.File, java.io.FileFilter)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</pre>
<div class="block">Construct an observer for the specified directory and file filter.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory to observe</dd><dd><code>fileFilter</code> - The file filter or null if none</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(java.io.File, java.io.FileFilter, org.apache.commons.io.IOCase)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory to observe</dd><dd><code>fileFilter</code> - The file filter or null if none</dd><dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd></dl>
</li>
</ul>
<a name="FileAlterationObserver(org.apache.commons.io.monitor.FileEntry, java.io.FileFilter, org.apache.commons.io.IOCase)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FileAlterationObserver</h4>
<pre>protected&nbsp;FileAlterationObserver(<a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor">FileEntry</a>&nbsp;rootEntry,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
                      <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
<div class="block">Construct an observer for the specified directory, file filter and
 file comparator.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>rootEntry</code> - the root directory to observe</dd><dd><code>fileFilter</code> - The file filter or null if none</dd><dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getDirectory()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDirectory</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;getDirectory()</pre>
<div class="block">Return the directory being observed.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the directory being observed</dd></dl>
</li>
</ul>
<a name="getFileFilter()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileFilter</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;getFileFilter()</pre>
<div class="block">Return the fileFilter.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the fileFilter</dd><dt><span class="strong">Since:</span></dt>
  <dd>2.1</dd></dl>
</li>
</ul>
<a name="addListener(org.apache.commons.io.monitor.FileAlterationListener)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addListener</h4>
<pre>public&nbsp;void&nbsp;addListener(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</pre>
<div class="block">Add a file system listener.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>listener</code> - The file system listener</dd></dl>
</li>
</ul>
<a name="removeListener(org.apache.commons.io.monitor.FileAlterationListener)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeListener</h4>
<pre>public&nbsp;void&nbsp;removeListener(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</pre>
<div class="block">Remove a file system listener.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>listener</code> - The file system listener</dd></dl>
</li>
</ul>
<a name="getListeners()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getListeners</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&gt;&nbsp;getListeners()</pre>
<div class="block">Returns the set of registered file system listeners.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The file system listeners</dd></dl>
</li>
</ul>
<a name="initialize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>public&nbsp;void&nbsp;initialize()
                throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Initialize the observer.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - if an error occurs</dd></dl>
</li>
</ul>
<a name="destroy()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroy</h4>
<pre>public&nbsp;void&nbsp;destroy()
             throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Final processing.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - if an error occurs</dd></dl>
</li>
</ul>
<a name="checkAndNotify()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkAndNotify</h4>
<pre>public&nbsp;void&nbsp;checkAndNotify()</pre>
<div class="block">Check whether the file and its chlidren have been created, modified or deleted.</div>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<div class="block">Provide a String representation of this observer.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>a String representation of this observer</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/FileAlterationObserver.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/io/monitor/FileAlterationObserver.html" target="_top">Frames</a></li>
<li><a href="FileAlterationObserver.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
